package com.salelogistics.basic.service.impl;

import java.util.List;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasSupplierMapper;
import com.salelogistics.basic.domain.BasSupplier;
import com.salelogistics.basic.service.IBasSupplierService;

/**
 * 供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-07
 */
@Service
public class BasSupplierServiceImpl implements IBasSupplierService 
{
    @Autowired
    private BasSupplierMapper basSupplierMapper;

    /**
     * 查询供应商
     * 
     * @param supplierId 供应商主键
     * @return 供应商
     */
    @Override
    public BasSupplier selectBasSupplierBySupplierId(Long supplierId)
    {
        return basSupplierMapper.selectBasSupplierBySupplierId(supplierId);
    }

    /**
     * 查询供应商列表
     * 
     * @param basSupplier 供应商
     * @return 供应商
     */
    @Override
    public List<BasSupplier> selectBasSupplierList(BasSupplier basSupplier)
    {
        return basSupplierMapper.selectBasSupplierList(basSupplier);
    }

    /**
     * 新增供应商
     * 
     * @param basSupplier 供应商
     * @return 结果
     */
    @Override
    public int insertBasSupplier(BasSupplier basSupplier)
    {
        basSupplier.setCreateTime(DateUtils.getNowDate());
        return basSupplierMapper.insertBasSupplier(basSupplier);
    }

    /**
     * 修改供应商
     * 
     * @param basSupplier 供应商
     * @return 结果
     */
    @Override
    public int updateBasSupplier(BasSupplier basSupplier)
    {
        return basSupplierMapper.updateBasSupplier(basSupplier);
    }

    /**
     * 批量删除供应商
     * 
     * @param supplierIds 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteBasSupplierBySupplierIds(Long[] supplierIds)
    {
        return basSupplierMapper.deleteBasSupplierBySupplierIds(supplierIds);
    }

    /**
     * 删除供应商信息
     * 
     * @param supplierId 供应商主键
     * @return 结果
     */
    @Override
    public int deleteBasSupplierBySupplierId(Long supplierId)
    {
        return basSupplierMapper.deleteBasSupplierBySupplierId(supplierId);
    }
}
